package com.woniuxy.goods.manaer.feigns;

import com.github.pagehelper.PageInfo;
import com.woniuxy.goods.module.goods.Goods;
import com.woniuxy.goods.module.goods.GoodsType;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "goods-server")
public interface GoodsFeignClient {
    @GetMapping("/goods/listPage")
    public PageInfo<Goods> findGoodsByPage(
            @RequestParam(value = "now",defaultValue = "1") Integer now,
            @RequestParam(value = "size",defaultValue = "2")Integer size,
            @RequestParam(value = "name",defaultValue = "") String name ,
            @RequestParam(value = "tid",defaultValue = "0")Integer tid) ;

    @GetMapping("/goods/typeList")
    public List<GoodsType> findTypeAll();

    @PostMapping("/goods/add")
    public Integer add(@RequestBody Goods goods);
}
